package com.hecate.common.exception;

import com.hecate.common.cons.StatusCode;


/**
 * 统一异常处理
 */

public class HecateBusinessException extends RuntimeException {

    private static final long serialVersionUID = -8716100844379461082L;


    private Integer status = StatusCode.ERROR.getCode();


    public HecateBusinessException(String msg) {
        super(msg);
    }


    public HecateBusinessException(String message, Integer status) {
        // 父类的构造函数；调用底层的Throwable的构造函数，将参数message赋值到detailMessage (Throwable的属性)
        super(message);
        // 赋值code码
        this.status = status;
    }

    public Integer getCode() {
        return status;
    }

    public void setCode(Integer code) {
        this.status = code;
    }

}
